package com.ge.energy.pgs.myfleet.code.factory;


import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import com.ge.energy.pgs.myfleet.code.servlet.websocket.MyWebSocket;
import com.ge.energy.pgs.myfleet.database.data.DataInitBean;


public class MyServletFactory extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

    private static Map<String,MyWebSocket> sockets;  
    
    public void init(ServletConfig config) throws ServletException {
    	MyServletFactory.sockets = new HashMap<String,MyWebSocket>();  
        super.init(config);  
        System.out.println("Server start============");  
        new DataInitBean().initData();
        new ChatRoomFactory().initChatRoomFactory();
    }  
      
    public static synchronized Map<String,MyWebSocket> getSockets() {  
        return MyServletFactory.sockets;  
    }

}
